"""
-*- coding:utf-8 -*-
最终版web自动化
Author: Free
DataTime: 2020/7/1 18:29

"""

from public_tools.configTool import ConfigTool
import unittest
from selenium import webdriver
import warnings
from public_tools.logTool import LoggingMethod

config = ConfigTool()
config.build_path(r'D:\commercial_opportunity_zhu\config\config.ini')
url = config.get('url', 'url')
user = config.get('TestUser', 'name')
password = config.get('TestUser', 'password')
change = config.get('TestUser', 'ChangeUser')
ChangeUser0 = config.get('TestUser', 'ChangeUser0')
ChangeUser1 = config.get('TestUser', 'ChangeUser1')


class TaskPublic(unittest.TestCase):

    def setUp(self):
        warnings.simplefilter("ignore", ResourceWarning)
        self.b = webdriver.Chrome()
        self.b.get(url)
        self.b.maximize_window()
        self.b.implicitly_wait(10)
        self.logger = LoggingMethod(__name__).get_logger()

    def tearDown(self) -> None:
        self.b.close()
        self.b.quit()
